<!-- expects a local variable "form" -->

<!-- put in all the information uploaded in hidden fields -->
<div>
<select name="work[author_attributes][ids][]" multiple="multiple" style="display:none;">
<%= options_from_collection_for_select(@allpseuds, :id, :name, @selected_pseuds) %>
</select>

<% unless @coauthors.blank? %>
<select name="work[author_attributes][coauthors][]" multiple="multiple" style="display:none;">
<%= options_from_collection_for_select(@coauthors, :id, :name, @selected_pseuds) %>
</select>
<% end %>

<%= form.hidden_field :rating_string, :value => "#{@work.rating_string}" %>
<%= form.hidden_field :warning_string, :value => "#{@work.warning_string}" %>
<%= form.hidden_field :category_string, :value => "#{@work.category_string}" %>
<%= form.hidden_field :fandom_string, :value => "#{@work.fandom_string}" %>
<%= form.hidden_field :relationship_string, :value => "#{@work.relationship_string}" %>
<%= form.hidden_field :character_string, :value => "#{@work.character_string}" %>
<%= form.hidden_field :freeform_string, :value => "#{@work.freeform_string}" %>

<%= form.hidden_field :title, :value => "#{@work.title}" %>
<%= form.hidden_field :summary, :value => "#{@work.summary}" %>
<%= form.hidden_field :collection_names, :value => "#{@work.collection_names}" %>
<%= form.hidden_field :recipients, :value => "#{@work.recipients}" %>
<%= form.hidden_field :notes, :value => "#{@work.notes}" %>
<%= form.hidden_field :endnotes, :value => "#{@work.endnotes}" %>
<%= fields_for "work[chapter_attributes]", @chapter do |c| %>
  <%= c.hidden_field :content, :value => "#{@chapter.content}" %>
  <%= c.hidden_field :title, :value => "#{@chapter.title}" %>
  <%= c.hidden_field :published_at, :value => "#{@chapter.published_at}" %>
<% end %>
<%= form.hidden_field :backdate, :value => "#{@work.backdate}" %>
<%= form.hidden_field :expected_number_of_chapters, :value => "#{@work.expected_number_of_chapters}" %>
<%= form.hidden_field :restricted, :value => "#{@work.restricted}" %>
<%= form.hidden_field :revised_at, :value => "#{@work.revised_at}" %>
<%= form.hidden_field :language_id, :value => "#{@work.language_id}" %>
<%= form.hidden_field :work_skin_id, :value => "#{@work.work_skin_id}" %>
</div>
